import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component:Home
  },
  {
    path: '/about',
    name: 'About',
    component: () => import('../views/About.vue'),
  },
  {
    path: '/hello',
    name: 'Hello',
    component: () => import('../views/Hello.vue'),
    children:[
      {
        path:'news/:id',
        name:'News',
        component:()=>import('../views/News.vue')
      }
    ]
  },
  {
    path: '/case',
    name:'Case',
    component: ()=>import('../views/Case')
  }
]

const router = new VueRouter({
  // mode:'history',  //去除地址栏的#号
  // mode:'hash', //默认
  // mode:'abstract', //开发者模式
  routes
})

export default router
